package com.baidu.xiaosu.service;

import com.baidu.xiaosu.bean.User;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class DemoFullFactory implements FallbackFactory<Demo> {
    @Override
    public Demo create(Throwable cause) {
        return new Demo() {
            @Override
            public User getById(String id) {
                User user = new User();
                user.setName("服务器错误");
                user.setPassword("服务器错误");
                return user;
            }
        };
    }
}
